/**
 *Copyright (c) 2003, 2018, UMF and/or its affiliates. All rights reserved.
 */
package com.umf.b2b.model.refund;

import com.umf.b2b.MerchantBaseRequest;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.util.UMFUtil;

import java.util.List;

/**
<p>Title:RefundRequest</p>  
<p>Description: �˿��</p>
 */
public class RefundRequest extends MerchantBaseRequest{
	
	private String notify_url;//*����ش������׳ɹ��󣬻ᰴ�մ˵�ַ�����׽���Ժ�̨�ķ�ʽ���͵��̻�ƽ̨����������в����򲻸��̻�ƽ̨�����첽֪ͨ
	private String order_id;//�˷ѵ��ţ�*����ش� [��Ӧ����] ƽ̨���ɵ�Ψһ��� �˷Ѷ����Ų��ܸ����Ѷ������ظ���
	private String mer_date;//*����ش� [��Ӧ����] �˷����� yyyyMMdd
	private String amount;//*����ش� �˿����������ң���λΪ��
	private String ori_order_id;//*����ش� [��Ӧ����] ԭ���Ѷ�����
	private String ori_mer_date;//*����ش� [��Ӧ����] ԭҵ������
	private String ori_mer_trace;//*����ش� ԭ�̻�֧����ˮ
	private String fee_payer;//*����ش� ���е��� 0-�̻��е� 1-ƽ̨�е�
	private List<RefundCmd> refund_cmd;//*����ش� �˷�ָ��
	private String url = "/refund/refundOrder";
	
	private String mer_check_date;//[��Ӧ����]

	@Override
	public String getRequestUrl() {
		return baseUrl + url;
	}

	@Override
	public RefundRequest doRequest() throws Exception {
		Message<RefundRequest> response = UMFUtil.post(createAPIContext(), this,RefundRequest.class);
		MerchantBaseRequest baseResult = convertResult(response, RefundRequest.class);
		if(baseResult == null)
			return null;
		return (RefundRequest)baseResult;
	}

	public String getMer_id() {
		return mer_id;
	}

	public void setMer_id(String mer_id) {
		this.mer_id = mer_id;
	}

	public String getNotify_url() {
		return notify_url;
	}

	public void setNotify_url(String notify_url) {
		this.notify_url = notify_url;
	}

	public String getOri_order_id() {
		return ori_order_id;
	}

	public void setOri_order_id(String ori_order_id) {
		this.ori_order_id = ori_order_id;
	}

	public String getOri_mer_date() {
		return ori_mer_date;
	}

	public void setOri_mer_date(String ori_mer_date) {
		this.ori_mer_date = ori_mer_date;
	}

	public String getOrder_id() {
		return order_id;
	}

	public void setOrder_id(String order_id) {
		this.order_id = order_id;
	}

	public String getMer_date() {
		return mer_date;
	}

	public void setMer_date(String mer_date) {
		this.mer_date = mer_date;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getOri_mer_trace() {
		return ori_mer_trace;
	}

	public void setOri_mer_trace(String ori_mer_trace) {
		this.ori_mer_trace = ori_mer_trace;
	}

	public String getFee_payer() {
		return fee_payer;
	}

	public void setFee_payer(String fee_payer) {
		this.fee_payer = fee_payer;
	}

	public String getMer_check_date() {
		return mer_check_date;
	}

	public void setMer_check_date(String mer_check_date) {
		this.mer_check_date = mer_check_date;
	}

	public List<RefundCmd> getRefund_cmd() {
		return refund_cmd;
	}

	public void setRefund_cmd(List<RefundCmd> refund_cmd) {
		this.refund_cmd = refund_cmd;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("RefundRequest [notify_url=");
		builder.append(notify_url);
		builder.append(", order_id=");
		builder.append(order_id);
		builder.append(", mer_date=");
		builder.append(mer_date);
		builder.append(", amount=");
		builder.append(amount);
		builder.append(", ori_order_id=");
		builder.append(ori_order_id);
		builder.append(", ori_mer_date=");
		builder.append(ori_mer_date);
		builder.append(", ori_mer_trace=");
		builder.append(ori_mer_trace);
		builder.append(", fee_payer=");
		builder.append(fee_payer);
		builder.append(", refund_cmd=");
		builder.append(refund_cmd);
		builder.append(", url=");
		builder.append(url);
		builder.append(", mer_check_date=");
		builder.append(mer_check_date);
		builder.append(", version=");
		builder.append(version);
		builder.append(", mer_id=");
		builder.append(mer_id);
		builder.append(", ret_code=");
		builder.append(ret_code);
		builder.append(", ret_msg=");
		builder.append(ret_msg);
		builder.append(", links=");
		builder.append(links);
		builder.append("]");
		return builder.toString();
	}
}
